package com.fast.entity;

import com.fast.utils.validator.group.AddGroup;
import com.fast.utils.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


@Data
public class SysUser implements Serializable {
    private static final long serialVersionUID = 1L;



    @NotNull( message = "userId 不能为空" ,groups = UpdateGroup.class)
    private Long userId ;

    @NotBlank( message = "用户名不能为空" , groups = { UpdateGroup.class , AddGroup.class})
    private String username ;

    @NotBlank(message="密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String password ;

    private String salt ;

    @NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
    private String email ;

    @NotBlank(message = "手机号码不能为空" , groups = {AddGroup.class , UpdateGroup.class})
    private String mobile ;

    private Integer status ;

    @NotNull(message="部门不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Long deptId;

    private Date createTime;




}
